testsuite: Avoid passing NULL to strcmp()
authorBenjamin Otte <otte@redhat.com>
Fri, 6 Mar 2020 03:31:08 +0000 (04:31 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 6 Mar 2020 04:43:56 +0000 (05:43 +0100)
Use g_strcmp0() instead.

testsuite/gtk/action.c

index 056e60fc80bfd690c47ee4f689a6638c6d5c762d..23a78fa23e3c6f5b330d800d4c81dcbecb1b9d14 100644 (file)
@@ -379,10 +379,8 @@ test_introspection (void)
     {
       g_assert (expected[i].owner == owner);
       g_assert (strcmp (expected[i].name, name) == 0);
-      g_assert ((expected[i].params == NULL && params == NULL) ||
-                strcmp (expected[i].params, g_variant_type_peek_string (params)) == 0);
-      g_assert ((expected[i].property == NULL && property == NULL) ||
-                strcmp (expected[i].property, property) == 0);
+      g_assert (g_strcmp0 (expected[i].params, params ? g_variant_type_peek_string (params) : NULL) == 0);
+      g_assert (g_strcmp0 (expected[i].property, property) == 0);
       i++;
     }
   g_assert (i == G_N_ELEMENTS (expected));